<template>
  <div class="c-w100 c-h100vh c-text-hidden c-p">
    <img class="c-w100 c-h-auto c-minh100vh" src="https://kposshzcdn.ckjr001.com/admin/material/9_material_admin/image/assets/i/wap/xhsEquity/xhs-bg.png" alt="">
    <div class="c-pa xhs-btn c-pz1 c-w100 c-flex-column c-flex-center">
      <div class="c-fs24 c-fc-xblack c-mb20">如未自动跳转，请点击下方按钮</div>
      <img @click="goToMiniProgram" class="c-ww360 c-h-auto" src="https://kposshzcdn.ckjr001.com/admin/material/9_material_admin/image/assets/i/wap/xhsEquity/xhs-btn.png" alt="">
    </div>
  </div>
</template>

<script>
// 注意：该页面主要是为了履约小程序小红书领取权益页面，未注册时，作为中转页，授权后跳回履约小程序，不做其他逻辑处理
import { utilJs } from "@/utils/common.js";
export default {
  name: "XhsEquityIndex",
  components: {
  },
  props: [],
  data() {
    return {
    };
  },
  watch: {},
  created() {
    // 履约小程序小红书领取权益页面，未注册时，作为中转页，授权后，跳回履约小程序
    if (localStorage.getItem(localStorage.getItem("companyId") + "|token") && this.$route.query.isFromXhsEquity == 1) {
      this.goToMiniProgram()
    }
    utilJs.appShare(this);
  },
  mounted() {},
  computed: {},
  methods: {
    goToMiniProgram() {
      // 判断是否在履约小程序环境下
      if (this.$isWxApp() && (this.$route.query.isKpStudy == 1 || sessionStorage.getItem("isKpStudy") == 1)) {
        utilJs.miniProgramGoTo("replace", `/pages/xhsEquity/index?c=${this.$route.query.equityCode}&companyId=${this.$route.query.companyId}`)
      }
    },
    //分享
    wechatShare: function () {
      utilJs.wechatConfig("", "", "", "", function () { });
    },
    //手机端分享
    appShare: function () {
      utilJs.appShareTrue("", "", "", "");
    },
  },
  activated() {
    setDocumentTitle("领取小红书权益");// eslint-disable-line
  }
};
</script>

<style scoped>
.xhs-btn {
  top: 70%;
}
</style>
